<?php
    include('session.inc');
    require_once('funct.inc');
    include 'color_style.php';
    include LANGUAGE;
    if(!GetAdminID($ID)){echo LOGIN_ERR;exit;}
    if(!Right_Check(5)){header('Location:error.php');exit;}
    

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <?php echo '<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET_.';">'; ?>

    <?php include 'html_style.php';?>

</head>
<?php
print "<body bgcolor=".Background_Color.">";



require_once('OpenDB.inc');
require_once('functs.inc');
do
{
    if (!OpenDB()){echo OPEN_DB_ERR; break;}

   if($_REQUEST["PageQuanter"]=="")
       $PageNo=$_REQUEST["PageNo"];
    else
       $PageNo=$_REQUEST["PageNo"]-1;

    if($PageNo=="" || $PageNo==-1) $PageNo=0;
 //Definicie tovarov=================================
    $ItemsOnPage = ITEMSONPAGE;
    $ShowQvantumPage = SHOWQVANTUMPAGE;
 //===================================================
    $ActualQvantumPage=$_REQUEST["ActualQvantumPage"];
    if($ActualQvantumPage=="")$ActualQvantumPage = 0;

    $Logged_Admin   =$_SESSION['admin'];
    $index=0;
    $roll_edit="/";
    $roll_show="/";

    $events=$_REQUEST["events"];
    switch($events) {
           case 'delete_adm':       //SQL_Delete_Adm($_REQUEST["A_ID"]); break;
                                                                   //***
                                                                   if ($_REQUEST["GrantDelete"]!="YES")
                                                                     print"
                                                                             <center>
                                                                                     <table border=\"1\" bgcolor=\"".BACKGROUND_IN_TABLE."\">
                                                                                             <tr>
                                                                                                     <td>
                                                                                                             ".A_VYMAZANIE."
                                                                                                             <center><form action=\"adm_acount_management.php\" target=\"place\" method=\"post\">
                                                                                                    <input type=\"hidden\" value=\"".$ActualQvantumPage."\" NAME=\"ActualQvantumPage\" />
                                                                                                    <input type=\"hidden\" name=\"events\" value=\"delete_adm\" />
                                                                                                    <input type=\"hidden\" name=\"A_ID\" value=\"".$_REQUEST["A_ID"]."\" />
                                                                                                    <input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />
                                                                                                    <input type=\"hidden\" name=\"GrantDelete\" value=\"YES\" />
                                                                                                    <input type=\"submit\" value=\"".A_ANO."\" style=\"width :100px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BTN_IN_TABLE."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                                                                                    </form> </center><center>
                                                                                                    <form action=\"adm_acount_management.php\" target=\"place\" method=\"post\" />
                                                                                                    <input type=\"hidden\" value=\"".$ActualQvantumPage."\" NAME=\"ActualQvantumPage\" />
                                                                                                    <input type=\"hidden\" name=\"events\" value=\"show_order\" />
                                                                                                    <input type=\"hidden\" name=\"A_ID\" value=\"".$_REQUEST["A_ID"]."\" />
                                                                                                    <input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />
                                                                                                    <input type=\"submit\" value=\"".A_NIE."\" style=\"width :100px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BTN_IN_TABLE."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                                                                                    </form></center>
                                                                                                     </td>
                                                                                             </tr>
                                                                                     </table>
                                                                             </center>
                                                                                ";
                                                                        else
                                                                             SQL_Delete_Adm($_REQUEST["A_ID"]);
                                                                             //print "V testovacej verzii je t�to funkcia zablokovan�!";
                                                                        break;




           case 'update_adm_save':  if($_REQUEST["A_Passwd"]=="" OR $_REQUEST["A_Passwd2"]=="") {
                                    $roll_edit = $_REQUEST["roll_edit"];
                                    $roll_show = $_REQUEST["roll_show"];
                                    break;
                                    }
                                    if($_REQUEST["A_Passwd"]!=$_REQUEST["A_Passwd2"]) {
                                    $roll_edit = $_REQUEST["roll_edit"];
                                    $roll_show = $_REQUEST["roll_show"];
                                    break;
                                    }
                                    if(SQL_Control_Duplicate($_REQUEST["A_Nick"],$_REQUEST["A_ID"])){
                                            print  "<script language=\"JavaScript\">
                                            <!--
                                            window.alert(\"".A_ALERT." '".$_REQUEST["A_Nick"]."'\");
                                            //-->
                                         </script>";
                                    $roll_edit = $_REQUEST["roll_edit"];
                                    $roll_show = $_REQUEST["roll_show"];
                                    break;
                                    }
                                    else{
                                       
                                       if (!SQL_Update_Adm($_REQUEST["A_ID"],$_REQUEST["A_Name"],
                                                      $_REQUEST["A_Surname"],$_REQUEST["A_Nick"],
                                                      sha1($_REQUEST["A_Passwd"]),sha1($_REQUEST["A_Passwd2"]),
                                                      "/".$_REQUEST[right_products].$_REQUEST[right_orders]
                                                      .$_REQUEST[right_discuss].$_REQUEST[right_users]
                                                      .$_REQUEST[right_admin].$_REQUEST[right_statistic]))
                                           print A_ALERT2;
                                       
                                       //print "V testovacej verzii je t�to funkcia zablokovan�!";
                                       $roll_edit = rutine_menu($_REQUEST["roll_edit"],$_REQUEST["A_ID"]);
                                       $roll_show=$_REQUEST["roll_show"];
                                       break;
                                    }
           case 'show_adm':         $roll_show = rutine_menu($_REQUEST["roll_show"],$_REQUEST["A_ID"]);
                                    $roll_edit=$_REQUEST["roll_edit"];
                                    break;
           case 'update_adm_form':  $roll_edit = rutine_menu($_REQUEST["roll_edit"],$_REQUEST["A_ID"]);
                                    $roll_show=$_REQUEST["roll_show"];
                                    break;
           default:break;
    }

    print("<center><b>".A_TITULOK."</b></center>");

    PrintLine();

    print "<center>
             <form action=\"adm_insert_acount.php\" target=\"place\" method=\"post\">
                <input type=\"submit\" value=\"".A_PRIDAT_KONTO."\" style=\"width :220px;height:20px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
             </form>
           </center>";

    PrintLine();


    //**************************************************************************
    //
    //Vytvorenie menu pre vyber zobrazovanej stranky  ulozene hore
    //
    //**************************************************************************
    $sql_psel= "SELECT COUNT(*) FROM admins";
    $sql_array_adm = mysql_fetch_row(mysql_query($sql_psel));
    if($sql_array_adm[0]/$ItemsOnPage==($PageNo)) $PageNo--;
    if($sql_array_adm[0]/$ItemsOnPage<=$ActualQvantumPage) $ActualQvantumPage=$ActualQvantumPage-$ShowQvantumPage;
    do{
      if (($sql_array_adm[0]/$ItemsOnPage)<=1) break;
     print"<center><table style=\"position:relative;  top:5px;\"><tr>";

// Podmienka prvej >>>> --------------------------------------------------------------------
      if(($sql_array_adm[0]/$ItemsOnPage>$ShowQvantumPage) and ($ActualQvantumPage-$ShowQvantumPage>=0)){
             print "<td>";
             print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
             if($sql_array_adm[0]>$ShowQvantumPage)
               print "<input type=\"submit\" value=\"<<<\"  style=\"width :50px; background-color: ".BUTTON_ON_OUT.";\"
                             onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                             onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
               $xxx=$ActualQvantumPage-$ShowQvantumPage;
               $Pagexxx=$xxx;
               print "<input type=\"hidden\" value=\"".$Pagexxx."\" name=\"PageNo\" />";
               print "<input type=\"hidden\" value=\"".$xxx."\" name=\"ActualQvantumPage\" />";
               print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
               print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
             print "</form>";
             print "</td>";
             }
 //--------------------------------------------------------------------------------------

//podmienka zvysnych stranok------------------------------------------------------------
          if(($ActualQvantumPage/$ShowQvantumPage)==floor(($sql_array_adm[0]/$ItemsOnPage)/$ShowQvantumPage))
              { if($sql_array_adm[0]%$ItemsOnPage==0)
                    $ShowActualQvantumPage=((($sql_array_adm[0]/$ItemsOnPage)%$ShowQvantumPage));
                else
                    $ShowActualQvantumPage=((($sql_array_adm[0]/$ItemsOnPage)%$ShowQvantumPage)+1);
              }
          else
              {$ShowActualQvantumPage=$ShowQvantumPage;}
 //---------------------------------------------------------------------------------------
      for($i=$ActualQvantumPage;$i<$ActualQvantumPage+$ShowActualQvantumPage;$i++)
    {
      print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
          print "<td>";
          $Xi=$i+1;
          if($PageNo==$i)
            print "<input type=\"submit\" value=\"".$Xi."\" name=\"PageNo\"  style=\"width :50px; background-color: ".BUTTON_ON_OVER.";\" />";
          else
            print "<input type=\"submit\" value=\"".$Xi."\" name=\"PageNo\" style=\"width :25px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
          print "<input type=\"hidden\" value=\"1\" name=\"PageQuanter\" />";
          print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
          print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
          print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
          print "</form>";
          print "</td>";
    }

 //podmienka doprednej >>>> -----------------------------------------------------------
if(($sql_array_adm[0]/$ItemsOnPage) > ($ActualQvantumPage+$ShowQvantumPage)){
      print "<td>";
      print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
      print "<input type=\"submit\" value=\">>>\"  style=\"width :50px; background-color: ".BUTTON_ON_OUT.";\"
              onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
              onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
      $xxx=$ActualQvantumPage+$ShowQvantumPage;
      $Pagexxx=$xxx;
      print "<input type=\"hidden\" value=\"".$Pagexxx."\" name=\"PageNo\" />";
      print "<input type=\"hidden\" value=\"".$xxx."\" name=\"ActualQvantumPage\" />";
      print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
      print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
    print "</form>";
    print "</td>";
    }
 //--------------------------------------------------------------------------------------
    print "</tr></table></center>";
    PrintLine();
    }while(false);

    print "<br>";
    //**************************************************************************
    //
    //Naplneneie obsahu stranky datami z databazy
    //
    //**************************************************************************
    //if($Category_ID==""){mysql_close(); break;}
        $From   = $PageNo*$ItemsOnPage;
        $sql_psel=  "SELECT * FROM admins ORDER BY A_Surname LIMIT ".$From.",".$ItemsOnPage;
        $Product_source = mysql_query($sql_psel);
        $counter=0;
        while($sql_array_adm = mysql_fetch_object($Product_source))
        {
            $ShowAsEdit    = is_roll($roll_edit,$sql_array_adm->ID);
            $ShowAsDetails = is_roll($roll_show,$sql_array_adm->ID);
            if(!$ShowAsEdit AND !$ShowAsDetails)
            {
                    if(($counter%2))
                        print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_2."\">";
                    else
                        print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";

                            //zobrazenie nazvu tovaru
                    print "<tr><td>";
                        if(($counter%2))
                            print "<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_2."\"><tr>";
                        else
                            print "<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\"><tr>";

                    print "<td align=\"left\">";
                      print("<b><font color=\"black\">".$sql_array_adm->A_Name." ".$sql_array_adm->A_Surname."</font color></b>");
                    print "</td>";
                    print "<td align=\"right\">";
                      print("<b><font color=\"".TEXT_COLOR."\">(".$sql_array_adm->A_Nick.")</font color></b>");
                    print "</td>";
                    print "</tr></table></td>";

                    print "<td align=\"right\" width=\"83px\">";
                          print "<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\" />";
                            print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
                            print "<input type=\"hidden\" name=\"events\" value=\"show_adm\" />";
                            print "<input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />";
                            print "<input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />";
                            print "<input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />";
                            print "<input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />";
                            print "<input type=\"submit\" value=\"".A_ZOBRAZIT."\" style=\"width :80px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                          print "</form>";
                          print "</td>";
                    if (!($Logged_Admin==$sql_array_adm->ID)) {
                    print "<td align=\"right\" width=\"53px\">";
                          print "<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\" />";
                            print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
                            print "<input type=\"hidden\" name=\"events\" value=\"update_adm_form\" />";
                            print "<input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />";
                            print "<input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />";
                            print "<input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />";
                            print "<input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />";
                            print "<input type=\"submit\" value=\"".A_UPRAVIT."\" style=\"width :50px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                          print "</form>";
                          print "</td>";
                          }
                    if (!($Logged_Admin==$sql_array_adm->ID)) {
                        print "<td align=\"right\" width=\"63px\">";
                          print "<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
                            print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
                            print "<input type=\"hidden\" name=\"events\" value=\"delete_adm\" />";
                            print "<input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />";
                            print "<input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />";
                            print "<input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />";
                            print "<input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />";
                            print "<input type=\"submit\" value=\"".A_VYMAZ."\" style=\"width :60px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                          print "</form>";
                          print "</td></tr>";
                    }

            }
            else
            {
                if($ShowAsEdit){
                //nastavenie chcekboxov:
                if (Right_Find($sql_array_adm->A_Rights,1))
                    $ChBox[0]="checked"; else $ChBox[0]="";
                if (Right_Find($sql_array_adm->A_Rights,2))
                    $ChBox[1]="checked"; else $ChBox[1]="";
                if (Right_Find($sql_array_adm->A_Rights,3))
                    $ChBox[2]="checked"; else $ChBox[2]="";
                if (Right_Find($sql_array_adm->A_Rights,4))
                    $ChBox[3]="checked"; else $ChBox[3]="";
                if (Right_Find($sql_array_adm->A_Rights,5))
                    $ChBox[4]="checked"; else $ChBox[4]="";
                if (Right_Find($sql_array_adm->A_Rights,6))
                    $ChBox[5]="checked"; else $ChBox[5]="";
                //Zobrazenie formulara:
                          if(($counter%2))
                            print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_2."\">";
                          else
                            print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";
                          print"<tr><td>";
                            print"<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\">
                                <table border=\"0\">
                                <tr>
                                    <td> ".A_MENO.": </td>
                                    <td> <input type=\"text\" name=\"A_Name\" value=\"".$sql_array_adm->A_Name."\" /> </td>
                                </tr>
                                <tr>
                                    <td> ".A_PRIEZVISKO.": </td>
                                    <td> <input type=\"text\" name=\"A_Surname\" value=\"".$sql_array_adm->A_Surname."\" /> </td>
                                </tr>
                                <tr>
                                    <td> ".A_NICK.": </td>
                                    <td> <input type=\"text\" name=\"A_Nick\" value=\"".$sql_array_adm->A_Nick."\" /> </td>
                                </tr>
                                <tr>
                                    <td> ".A_HESLO.": </td>
                                    <td> <input type=\"password\" name=\"A_Passwd\" value=\"\" /> </td>
                                </tr>
                                <tr>
                                    <td> ".A_HESLO_OPAKUJ.": </td>
                                    <td> <input type=\"password\" name=\"A_Passwd2\" value=\"\" /> </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <br><b><u> ".A_RULES_KOMENTAR.": </u></b> </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <input type=\"checkbox\" value=\"1/\" name=\"right_products\" ".$ChBox[0]." /> ".A_RULES1." </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <input type=\"checkbox\" value=\"2/\" name=\"right_orders\" ".$ChBox[1]." /> ".A_RULES2." </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <input type=\"checkbox\" value=\"3/\" name=\"right_discuss\" ".$ChBox[2]." /> ".A_RULES3." </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <input type=\"checkbox\" value=\"4/\" name=\"right_users\" ".$ChBox[3]." /> ".A_RULES4." </td>
                                </tr>
                                <tr>
                                    <td colspan=\"2\"> <input type=\"checkbox\" value=\"5/\" name=\"right_admin\" ".$ChBox[4]." /> ".A_RULES5." </td>
                                </tr>";
                        if(file_exists("modules/top_products/top_products.php") OR file_exists("modules/top_user/top_user.php") OR file_exists('modules/valuations/adm_product_valuations.php'))
			               print"<tr><td colspan=\"2\"> <input type=\"checkbox\" value=\"6/\" name=\"right_statistic\" ".$ChBox[5]."/> ".A_RULES6." </td></tr>";
						   print"<tr>
                                    <td colspan=\"2\">
                                    <input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />
                                    <input type=\"hidden\" name=\"events\" value=\"update_adm_form\" />
                                    <input type=\"hidden\" name=\"events\" value=\"update_adm_save\" />
                                    <input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />
                                    <input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />
                                    <input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />
                                    <input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />
                                    <input type=\"submit\" value=\"".A_ULOZIT."\" style=\"width :300px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\"; />
                                    </td>
                                </tr>
                                </table>
                            </form>";
                          print "</td></tr>";
                          print "<tr><td align=\"right\" width=\"83px\">";
                            print "<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
                                print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
                                print "<input type=\"hidden\" name=\"events\" value=\"update_adm_form\" />";
                                print "<input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />";
                                print "<input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />";
                                print "<input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />";
                                print "<input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />";
                                print "<input type=submit align=\"right\" value='".A_NEULOZIT."' style=\"width :130px; position:relative;left:810px;top:0px;; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                            print "</form>";
                          print "</td></tr></table>";
                };

                if($ShowAsDetails){
                    if(($counter%2))
                        print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_2."\">";
                    else
                        print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";

                    print "<tr><td>";


                    //***********zobrazenie mena, priezviska, nick, prav********
                    if(($counter%2))
                        print "<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"".TR_BACKGOUND_COLOR_2."\">";
                    else
                        print "<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";

                    print "<tr>";
                        print "<td>";
                            print "".A_MENO.":";
                        print "</td>";
                        print "<td >";
                            print "<b><font color=\"black\">".$sql_array_adm->A_Name."</font color></b>";
                        print "</td>";
                    print "</tr>";
                    print "<tr>";
                        print "<td>";
                            print "".A_PRIEZVISKO.":";
                        print "</td>";
                        print "<td>";
                            print "<b><font color=\"black\">".$sql_array_adm->A_Surname."</font color></b>";
                        print "</td>";
                    print "</tr>";
                    print "<tr>";
                        print "<td>";
                            print "".A_NICK.":";
                        print "</td>";
                        print "<td>";
                            print "<b><font color=\"black\">".$sql_array_adm->A_Nick."</font color></b>";
                        print "</td>";
                    print "</tr>";
                    print "<tr>";
                        print "<td colspan=\"\"2>";
                            print "<br /><b><u>".A_RULES_KOMENTAR.":</u></b>";
                                if (Right_Find($sql_array_adm->A_Rights,1))
                                    print "<li>".A_RULES1."</li>";
                                if (Right_Find($sql_array_adm->A_Rights,2))
                                    print "<li>".A_RULES2."</li>";
                                if (Right_Find($sql_array_adm->A_Rights,3))
                                    print "<li>".A_RULES3."</li>";
                                if (Right_Find($sql_array_adm->A_Rights,4))
                                    print "<li>".A_RULES4."</li>";
                                if (Right_Find($sql_array_adm->A_Rights,5))
                                    print "<li>".A_RULES5."</li>";
                            if(file_exists("modules/top_products/top_products.php") OR file_exists("modules/top_user/top_user.php") OR file_exists('modules/valuations/adm_product_valuations.php')){
	                       			if (Right_Find($sql_array_adm->A_Rights,6))
                                    print "<li>".A_RULES6." </li>";
                        		}
					    print "</td>";
                    print "</tr>";
                    print "</table>";
                    //**********************************************************

                    print "</td><tr>";

                    print "<tr><td>";
                    print "<td align=\"right\" valign=\"bottom\" width=\"83px\">";
                          print "<form action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
                            print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
                            print "<input type=\"hidden\" name=\"events\" value=\"show_adm\" />";
                            print "<input type=\"hidden\" name=\"roll_edit\" value=\"".$roll_edit."\" />";
                            print "<input type=\"hidden\" name=\"roll_show\" value=\"".$roll_show."\" />";
                            print "<input type=\"hidden\" name=\"A_ID\" value=\"".$sql_array_adm->ID."\" />";
                            print "<input type=\"hidden\" name=\"PageNo\" value=\"".$PageNo."\" />";
                            print "<input type=\"submit\" value=\"".A_ZRUS_NAHLAD."\" style=\"width :120px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
                          print "</form>";
                    print "</td></tr>";

                    print "</table>";
                };
            }
            print "</table>";
            $counter++;
        }


        print "<br>";
        PrintLine();

    //**************************************************************************
    //
    //Vytvorenie menu pre vyber zobrazovanej stranky (rozdelenie zobrazovane hotovaru) - ulozene dole
    //
    //**************************************************************************
    $sql_psel= "SELECT COUNT(*) FROM admins";
    $sql_array_adm = mysql_fetch_row(mysql_query($sql_psel));
    do{
      if (($sql_array_adm[0]/$ItemsOnPage)<=1) break;

      print"<center><table style=\"position:relative;  top:5px;\"><tr>";

// Podmienka prvej >>>> --------------------------------------------------------------------
      if(($sql_array_adm[0]/$ItemsOnPage>$ShowQvantumPage) and ($ActualQvantumPage-$ShowQvantumPage>=0)){
             print "<td>";
             print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
             if($sql_array_adm[0]>$ShowQvantumPage)
               print "<input type=\"submit\" value=\"<<<\"  style=\"width :50px; background-color: ".BUTTON_ON_OUT.";\"
                             onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                             onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
               $xxx=$ActualQvantumPage-$ShowQvantumPage;
               $Pagexxx=$xxx;
               print "<input type=\"hidden\" value=\"".$Pagexxx."\" name=\"PageNo\" />";
               print "<input type=\"hidden\" value=\"".$xxx."\" name=\"ActualQvantumPage\" />";
               print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
               print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
             print "</form>";
             print "</td>";
             }
 //--------------------------------------------------------------------------------------

//podmienka zvysnych stranok------------------------------------------------------------
          if(($ActualQvantumPage/$ShowQvantumPage)==floor(($sql_array_adm[0]/$ItemsOnPage)/$ShowQvantumPage))
              { if($sql_array_adm[0]%$ItemsOnPage==0)
                    $ShowActualQvantumPage=((($sql_array_adm[0]/$ItemsOnPage)%$ShowQvantumPage));
                else
                    $ShowActualQvantumPage=((($sql_array_adm[0]/$ItemsOnPage)%$ShowQvantumPage)+1);
              }
          else
              {$ShowActualQvantumPage=$ShowQvantumPage;}
 //---------------------------------------------------------------------------------------

      for($i=$ActualQvantumPage;$i<$ActualQvantumPage+$ShowActualQvantumPage;$i++)
    {
      print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
          print "<td>";
          $Xi=$i+1;
          if($PageNo==$i)
            print "<input type=\"submit\" value=\"".$Xi."\" name=\"PageNo\"  style=\"width :50px; background-color: ".BUTTON_ON_OVER.";\" />";
          else
            print "<input type=\"submit\" value=\"".$Xi."\" name=\"PageNo\" style=\"width :25px; background-color: ".BUTTON_ON_OUT.";\"
                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
                            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
          print "<input type=\"hidden\" value=\"1\" name=\"PageQuanter\" />";
          print "<input type=\"hidden\" value=\"".$ActualQvantumPage."\" name=\"ActualQvantumPage\" />";
          print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
          print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
          print "</form>";
          print "</td>";
    }

 //podmienka doprednej >>>> -----------------------------------------------------------
if(($sql_array_adm[0]/$ItemsOnPage) > ($ActualQvantumPage+$ShowQvantumPage)){
      print "<td>";
      print "<form  action=\"adm_acount_management.php\" target=\"place\" method=\"post\">";
      print "<input type=\"submit\" value=\">>>\"  style=\"width :50px; background-color: ".BUTTON_ON_OUT.";\"
              onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\";
              onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />";
      $xxx=$ActualQvantumPage+$ShowQvantumPage;
      $Pagexxx=$xxx;
      print "<input type=\"hidden\" value=\"".$Pagexxx."\" name=\"PageNo\" />";
      print "<input type=\"hidden\" value=\"".$xxx."\" name=\"ActualQvantumPage\" />";
      print "<input type=\"hidden\" value=\"".$Path."\" name=\"path\" />";
      print "<input type=\"hidden\" value=\"".$Category_ID."\" name=\"ID\" />";
    print "</form>";
    print "</td>";
    }
 //--------------------------------------------------------------------------------------
    print "</tr></table></center>";
    PrintLine();
    }while(false);




        mysql_close();
}
while(false)
?>


</body>
</html>
